﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "IParameterValueStorage.h"

namespace gcmp
{
    class IParameterCustomData;

    /// \brief 自定义类型参数接口类
    class GCMP_MODEL_INTERFACE_EXPORT IParameterValueCustom : public IParameterValueStorage
    {
    public:
        DEFINE_CAST_DERIVED(gcmp::IParameterValueCustom, gcmp::IParameterValueStorage)

    public:
        /// \brief 创建一个自定义类型参数存储对象
        ///
        /// \param id 自定义参数ID，方便使用者识别数据
        /// \param version 数据的版本
        /// \param value 参数值
        /// \return 创建出来的参数值存储对象
        static OwnerPtr<IParameterValueCustom> Create(OwnerPtr<IParameterCustomData> opCustomData);

        /// \brief 设置自定义数据
        /// \param value 自定义数据
        /// \return true 设置成功， false 设置失败
        virtual bool SetCustomData(OwnerPtr<IParameterCustomData> value) = 0;
        
        /// \brief 获取自定义数据
        /// \return NdbObject* 自定义数据
        virtual const IParameterCustomData* GetCustomData() const = 0;
    };
}


